$(function(){
	$("div.pagination ul li a").bind("click",function(event){
		 var url =  $(this).attr("link");		
	     doGet(url);
	});
});
function doActionWork(url, eid,stepId,actionId,name) {
	var param = {
			"workflowId" : eid,
			"stepId":stepId,
			"actionId":actionId,
			"userView" : true,
			"workflowName.workflowName":name
		};
	$.post(url,$.param(param));
}


function openForm(id){
	window.open('admin/form/show/generate-html!viewform?workflowId='+id,'formwin');
}


function openOffice(id){
	window.open('workflow/document/document!readoffice?workflowId='+id,'officewin');
}

function completeWorkflow(id){
	if(!confirm("确定执行该操作吗?")){
		return;
	}
	var url = "workflow/proceed/proceed!complete?workflowId="+id;
	$.post(url);	
}

function killWorkflow(id){
	if(!confirm("确定执行该操作吗?")){
		return;
	}
	var url = "workflow/proceed/proceed!delete?workflowId="+id;
	$.post(url);	
}
function rollback(id){
	if(!confirm("确定执行该操作吗?")){
		return;
	}
	var url="workflow/proceed/proceed!rollback";
	var data = "workflowId="+id;
	$.post(url,data);
}
function doWork(wid,step,action,wname){
	var param ={
		"workflowId" : wid,
		"stepId":step,
		"actionId":action,
		"userView" : true,
		"workflowName.workflowName":wname
	};
	var url = "workflow/proceed/proceed!prework";
	doPost(url,$.param(param));
	
	
}
function doWatch(wid){
	var url="workflow/data/query-data!watch?workflowId="+wid;
	doGet(url);
}